<?php

/***

LZRoster: A roster for World of Warcraft.
Copyright (C) 2007  Emmanuel Cron

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

***/

require_once dirname(__FILE__)."/../class/Client.class.php";
require_once dirname(__FILE__)."/../class/Config.class.php";
require_once dirname(__FILE__)."/../class/SessionRoster.class.php";
require_once dirname(__FILE__)."/../class/Localization.class.php";

$client = Client::GetInstance();
$config = Config::GetInstance();
$localization = Localization::GetInstance();
$session_roster = SessionRoster::GetInstance();

?>

<h1>LZRoster</h1>


<?php
if ($client->GetCurrentPage() != "install.php")
{
	if ( $session_roster->IsConnected() )
	{
	?>
		<p id="c_language_connected">
			<img src="img/pin.gif" alt="" style="vertical-align: middle;" />
			
			<span>
				<?php echo $localization->Get('connected as'); ?>:
			</span>
			
			<strong><?php echo $session_roster->GetAccountName(); ?></strong>
		</p>
		
		<p id="c_language">
			<img src="img/admin.gif" alt="" />
			<a href="admin.php"><?php echo $localization->Get('admin'); ?></a>
			
			<img src="img/bullet.gif" alt="" />
			<a href="preferences.php"><?php echo $localization->Get('preferences'); ?></a>
			
			<img src="img/key-grey.gif" alt="" />
			<a href="disconnection.php"><?php echo $localization->Get('logout'); ?></a>
		
	<?php
	}
	elseif ($config->HasConfig())
	{
	?>
		<p id="c_language">		
			<img src="img/key.gif" alt="" />
			<a href="connection.php"><?php echo $localization->Get('connection/register'); ?></a>
	
	<?php
	}
	else
	{
	?>
		<p id="c_language">		
			
	<?php
	}
}
else
{
?>

	<p id="c_language">	
	
<?php
}
?>
	
<img src="img/wow.png" alt="" />
<a href="change_language.php?from=<?php echo $client->GetCurrentPage(); ?>"><?php echo $localization->Get('change language'); ?></a>

</p>

<p id="head">
	<a href="./"><img src="<?php echo $config->GetRosterBannerUrl(); ?>" alt="HLogo" /></a>
</p>